// @APIVersion 1.0.0
// @Title mobile API
// @Description mobile has every tool to get any job done, so codename for the new mobile APIs.
// @Contact astaxie@gmail.com
package routers

import (
	"dougan/controllers"
	"github.com/astaxie/beego"
)

func init() {

	ns := beego.NewNamespace("/v1",
		beego.NSRouter("/index", new(controllers.MainController)),

		beego.NSNamespace("/task", //为了使用swag，必须放弃include写法
			beego.NSRouter("/", &controllers.TaskController{}, "GET:GetAll"),
			beego.NSRouter("/", &controllers.TaskController{}, "POST:Post"),
			beego.NSRouter("/:id", &controllers.TaskController{}, "GET:GetOne"),
			beego.NSRouter("/:id", &controllers.TaskController{}, "PUT:Put"),
			beego.NSRouter("/:id", &controllers.TaskController{}, "DELETE:Put"),
		),
	)
	beego.AddNamespace(ns)
}
